import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
score =np.arange(0,160,10,dtype='int')
print('成绩数组score:\n',score)

height=np.linspace(1.5,2.5,11,retstep=True)
print('身高等差数组height:\n',height)

wheat=np.logspace(0,63,64,base=2,dtype='uint64')
print('棋盘麦粒等比数组wheat:\n',wheat)

x_arange=np.arange(0,2 * np.pi,0.1)
y_arange=np.sin(x_arange)

x_linspce=np.linspace(0,2 * np.pi,100)
y_linspace=np.sin(x_linspce)

plt.figure(figsize=(12,4))
plt.subplot(1,2,1)
plt.plot(x_arange,y_arange,label='arange')
plt.title('Using arange()')
plt.legend()

plt.subplot(1,2,2)
plt.plot(x_linspce,y_linspace,label='linspace')
plt.title('Using arange()')
plt.legend
plt.show()

time_arange=pd.date_range(start='2022-01-01',periods=365,freq='D')
time_linspace=pd.date_range(start='2022-01-01',end='2022-12-31',freq='D')
plt.figure(figsize=(10,4))
plt.subplot(1,2,1)
plt.plot(time_arange,np.random.rand(len(time_arange)),label='arange')
plt.title('Using arange()')
plt.legend()

plt.subplot(1,2,2)
plt.plot(time_linspace,np.random.rand(len(time_linspace)),label='linspace')
plt.title('Using linspace()')
plt.legend()
plt.show()

